package xuegao.study.mall.web.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xuegao.study.mall.web.domain.HomeContentResult;
import xuegao.study.mall.web.service.HomeService;
import xuegao.study.mall.repo.dao.pms.PmsProductCategoryDao;
import xuegao.study.mall.common.model.pms.PmsProductCategory;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class HomeServiceImpl implements HomeService {
    @Autowired
    private PmsProductCategoryDao pmsProductCategoryDao;

    @Override
    public HomeContentResult content() {
        return new HomeContentResult();
    }

    @Override
    public List<PmsProductCategory> getProductCateList(Long parentId) {
        Map<String, Object> params = new HashMap<>();
        params.put("parent_id", parentId);
        params.put("show_status", 1);
        return pmsProductCategoryDao.selectByMap(params);
    }
}
